# Author:Zhang Yu
from socket import socket,AF_INET,SOCK_STREAM

if __name__ == '__main__':
    s =socket(AF_INET,SOCK_STREAM) #默认值
    s.connect(('127.0.0.1',1234))
    while True:
        user_input = input(">>> ")
        if user_input:
            s.send(user_input.encode())
            res = s.recv(1024)
            print(res.decode())

